package com.xdtech.sys.service;

import java.util.List;

import com.xdtech.common.service.IBaseService;
import com.xdtech.sys.model.FilterTranslator;
import com.xdtech.sys.model.Resource;
import com.xdtech.sys.vo.ResourceItem;

/**
 * 
 * @author max.zheng
 * @create 2015-03-18 13:53:54
 * @since 1.0
 * @see
 */
public interface ResourceService extends IBaseService<Resource>{

	/**
	 * 保存更新信息
	 * @author max.zheng
	 * @create 2015-03-18 13:53:54
	 * @modified by
	 * @param item
	 * @return
	 */
	boolean saveOrUpdateResource(ResourceItem item);

	/**
	 * 加载记录信息
	 * @author max.zheng
	 * @create 2015-03-18 13:53:54
	 * @modified by
	 * @param newId
	 * @return
	 */
	ResourceItem loadResourceItem(Long resourceId);

	/**
	 * 根据id号删除记录信息
	 * @author max.zheng
	 * @create 2015-03-18 13:53:54
	 * @modified by
	 * @param id
	 * @return
	 */
	boolean deleteResourceInfo(long id);

	/**
	 * 
	 * @author max.zheng
	 * @create 2015-03-18 13:53:54
	 * @modified by
	 * @param resourceIds
	 */
	boolean deleteResourceInfo(List<Long> resourceIds);

	/**
	 * 更新资源权限定义
	 * @author <a href="max.zheng@zkteco.com">郑志雄</>
	 * @since 2015-3-19 上午9:20:44
	 * @param item
	 * @param ruleField
	 * @param ruleOption
	 * @param ruleValue
	 */
	void updateResource(ResourceItem item, String ruleField, String ruleType, String ruleValue,String ruleOption);

	/**
	 * 创建资源权限信息
	 * @author max.zheng
	 * @create 2015-3-21下午11:59:12
	 * @modified by
	 * @param resource
	 * @param translator
	 */
	void createResourcePermission(Resource resource, FilterTranslator translator);
}
